package com.xuzimian.globaldemo.designpatterns.proxy.dynamic.performance.handler;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class CglibHandler implements MethodInterceptor {
	private Object target;

	public CglibHandler(Object target) {
		this.target = target;
	}

	@Override
	public Object intercept(Object proxy, Method method, Object[] args,
							MethodProxy methodProxy) throws Throwable {
		Object result = methodProxy.invoke(target, args);
		return result;
	}
}
